package com.woniu.entity;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class Constant {
    @Value("${qiNiu.accesskey}")
    private String accesskey;
    @Value("${qiNiu.secretkey}")
    private String secretkey;
    @Value("${qiNiu.bucket}")
    private String bucket;

    public static String QINIU_ACCESSKEY;
    public static String QINIU_SECRETKEY;
    public static String QINIU_BUCKET;

    @PostConstruct
    public void init(){
        QINIU_ACCESSKEY = this.accesskey;
        QINIU_SECRETKEY = this.secretkey;
        QINIU_BUCKET = this.bucket;
    }

    // 定义redis相关的常量
    public static final String REDIS_ALL_UPLOAD_IMAGE = "redis_all_upload_image";
    public static final String REDIS_DB_UPLOAD_IMAGE = "redis_db_upload_image";
}
